Disclaimer - I've studied MIDI but never actually used it.
The easiest thing would be a software-only MIDI controller that sends pre-programmed MIDI messages to your computer or MIDI instrument. i.e. It could be programmed to play one or more tunes, or a drum-rhythm, etc. That's not a full drum machine... The drum sounds (or music) would be generated by your computer or MIDI instrument.
Anything that actually makes sound (other than very simple boring square wave tones) is beyond what the basic-Arduino can do by itself. You can get an Audio Shield to play "samples" controlled by the Arduino but the sounds would have to be pre-loaded and that's a lot more limited than most "real" MIDI instruments.
A sampler that "captures" sound is also beyond what the Arduino can do by itself, and probably not worth doing yourself.
The next step up would be a drum controller with drum pads (just a few inputs). IMO - Building a full keyboard-controller is not worth the the time or cost. That's something you should buy.