Midi files are
binary files[
^], which you can convert into text files with different channels etc.
The sheet music convertion is quite complicated, there are after all a reason that people sell these things at a rather steep price...
[Edit]You could try a search here thoug,
C# MIDI Toolkit[
^][/Edit]