while you have to write the arduino code on your own, i can tell you how to make a pc receive MIDI data through arduino usb: you need to replace the ATmega8u2 (the little chip near the usb socket in arduino uno) firmware with another one called "MIDI/MODO for LUFA".
just follow these steps:
-enter DFU mode (to reprogram the atmega8u2) http://arduino.cc/en/Hacking/DFUProgramming8U2
-when prompted, upload this firmware instead http://web.mac.com/kuwatay/morecat_lab./MocoLUFA_files/MocoLUFA-110123.tgz
for any windows issues read this http://andrewmemory.wordpress.com/2011/04/14/upgrading-the-arduino-uno-8u2-using-flip/
now your pc sees your arduino as a generic midi device, so it can't be programmed. to undo everything just follow the first step (with the standard firmware).
now you just have to write you arduino code, upload it you arduino and change the firmware with the steps above!!!