Have a look at my MIDI Controller library. It does everything you need.
It supports pretty much any Arduino or Teensy board, however, Teensy boards or Arduino boards with native USB support (e.g. Leonardo) are much easier to use. If you want to use an Uno or Mega, you'll need to flash custom MIDI firmware, which is very cumbersome.
Read more here.
Pieter