OK, having gotten that out of the way...these are the steps I would take.
For the USB in...you are going to need a little hardware to handle that MIDI in, for example:
http://www.instructables.com/id/Sen...no/step10/Receive-MIDI-Messages-with-Arduino/
Amanda has some good stuff in that and other tutorials.
Also, more locally:
https://forum.pjrc.com/threads/28112-MIDI-in-with-PC900V-just-won-t-work?highlight=optoisolator
Not expensive, but probably $4 right there if you don't have parts handy.
For testing, AND AS THE FRAMEWORK FOR MY CODE, I would use the MIDI_callbacks example in the MIDI library. It receives MIDI messages and then jumps to the code to handle them. This is exactly what you want. For example, where it says:
void handleNoteOn(byte channel, byte pitch, byte velocity)
{
// Do whatever you want when a note is pressed.
// Try to keep your callbacks short (no delays ect)
// otherwise it would slow down the loop() and have a bad impact
// on real-time performance.
}
You should put code to blink the LED and/or send a debug message. Then, test the hardware MIDI in. Works? Great.
Now instead of blinking the onboard LED in the callback routine, shoot your note on MIDI message out via via usbMIDI, like
usbMIDI.sendNoteOn(note, vel, channel);
...having previously defined those byte variables. Your needs are simple, and that program is pretty close to what you need already. You will have to put in almost identical handlers for NoteOff and whatever other MIDI message types you want to send through (pitch bend and other CCs, perhaps). Other message types you don't want to deal with just go away like magic.
For more info on the USB side, try Teensy USB_MIDI code examples and info from this page:
https://www.pjrc.com/teensy/td_midi.html . If it's not clear, start by loading up the buttons example and get that working with one or more buttons as a proof of concept. You are going to need some clues from the buttons example anyway, like
// You must select MIDI from the "Tools > USB Type" menu
and that bit of code at the end about discarding messages:
// MIDI Controllers should discard incoming MIDI messages.
It took me years to realize: It's also okay to realize that you would rather make music than spend time farting with things--that's why an effects box with $5 of parts inside can sell for >$100.