Learn to use Google so you can, at least, get basic information then ask specific questions here.
There is a lot of information out there, some on CodeProject, such as
this[
^]. There are also many open-source MIDI programs available for you to learn from, such as what is on
SourceForge[
^].