The USB specs are pretty large.
Good description of the protocol .
Another source .
USB communications can be spyed with:
Software Wireshark (example video there ).
Hardware OpenVizsla An Open-source FPGA-based USB sniffer ... based of the Xilinx Spartan 6 LX9 TQFP144 (nice choice!).
About the STM32F1
The IP cores for STM32F1xx are not consistent among all versions:
- STM32F103xx (medium density, performance line) and STM32F102xx (medium density, USB access line): USB "USB full-speed device interface". (seems like made by ST)
- STM32F105xx and STM32F107xx (connectivity line): OTG_FS "USB on-the-go full-speed". (seems like bought at Synopsys)
For the USB ip, the user manual is UM0424 . Note that the standard ST all-in-one header file for register definitions (stm32f10x.h) cannot be used alone because the registers for USB are not defined. You have to add you own header. For example, ChibiOS/RT did it there .
 USB 2.0 specifications, http://www.usb.org/developers/docs/usb_20.zip
 USB Made Simple, http://www.usbmadesimple.co.uk
 USB in a NutShell, USB Protocols, http://www.beyondlogic.org/usbnutshell/usb3.shtml
 SiliconLab, http://www.silabs.com/Support%20Documents/Software/USB_Overview.pdf
 OpensourceH4ck3r, How to reverse engineer a USB protocol for Linux, https://www.youtube.com/watch?v=GdvmsWnZkyc
 OpenVizsla, project homepage, http://openvizsla.org/
 STM32 USB-FS-Device development kit, http://www.st.com/st-web-ui/static/active/cn/resource/technical/document/user_manual/CD00158241.pdf
 ChibiOS/RT, stm32_usb.h, http://chibios.sourceforge.net/docs/hal_stm32l1xx_rm/stm32__usb_8h_source.html