After working with the STM32Cube software, I have to agree with @dannyf that it is piece of crap.
But the old library is no better. I stuck with the USB library (CDC) for couple of days and found some primary school level mistake by their engineer
.
So in case someone want to have their CDC example to work, use the patch attached.