Arduino Yun USB host - reading usb MIDI data and passing forward to another device
You need the USB Audio kernel driver and the aconnect utility:

$ opkg update
$ opkg install kmod-usb-audio
$ opkg install alsa-utils-aconnect


Then just connect the ports:

$ aconnect -lio
client 0: 'System' [type=kernel]
    0 'Timer           '
    1 'Announce        '
client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
client 40: 'SC-8820' [type=kernel]
    0 'SC-8820 Part A  '
    1 'SC-8820 Part B  '
    2 'SC-8820 MIDI    '
client 44: 'My Little Keyboard' [type=kernel]
    0 'My Little Keyboard MIDI 1'
$ aconnect "My Little Keyboard" SC-8820
$


(This is plain Linux and does not need to run anything on the ATmega.)