How to do this USB transfer?
If you want data to Notepad, then the STM32 must be a keyboard HID to the PC, and it must convert serial data to keyboard presses. STM32 must have USB. But this may not be what you want.

If however the point is to watch serial data on screen and log it to a file, you would use a terminal program like putty to open a serial port. No microcontroller involved, just get a suitable serial cable or USB to serial adapter and it is done.