You seem to lack the ability to present your problems in a way others might be able to help.
"Not working" isn't particularly enlightening, you'll have to do some debugging. As Pavel suggests you might have to do this via instrumentation as you can't stop a USB device dead in a classic debugger sense as it will appear non-responsive to PCs trying to access it.
What boards are you using? Are other examples working? Provide some context.
Is it appropriate to run the MCU at a fraction of the speed of the USB peripheral?
The same code i tried on my STM32F407 discovery board. Its working like a charm. Just for getting to know that my flow of execution i added LED in if condition.I haven't tried another example yet.