Does your device show up, or just an unknown device?
If your device actually enumerates properly, but disconnects after just a few seconds, my guess would be that you're either blocking in the DataIn/DataOut callback, or that you're running from the HSI (which isn't stable enough for USB).
If it shows up as an unknown device, make sure the IRQs are working (NVIC configured, ISRs in place).
I do most of my development on Linux, but if I remember correctly, it takes very little for Windows to go "bing" when you connect an USB device. It might be as little as just having the D+ pullup..