I've just published the code for my USBMIDIhost -> SerialMIDI converter. You may find something useful there, maybe:

https://forum.pjrc.com/threads/60610-MIDI-USB-Host-to-MIDI-Din-converter