The new MIDI API is already available in JUCE - look under the options of the juce_audio_devices module.
juce_audio_devices