Working with usb on stm32f103c8 bluepill
The problem is quite big. First you need to know how USB works, then implement your own USB driver on the MCU, and implement USB MIDI on top of the USB driver. You should consider running existing USB driver and stack provided by chip manufacturer, and implement USB MIDI on top of that. At least you can take the existing USB stack as an example even if you don't want to use it. The MCU peripheral details can be found in the reference manual, not in the datasheet.