I've created some basic musical notation software in C#. I have a "Sound" class that contains useful properties (Note, NoteType (Semibreve, quaver, etc.). I currently have functions that can use instances of these "Sound" classes to create frequency and duration which are used to play the note.
Now, I would just like to export this information as a midi file, how can I do this?
Basically you need either a library to convert your list of notes to MIDI or create your own. For the first option I didn't see any well documented library written in C#. However, you can check these two C#-MIDI-Toolkit and midi.net
For the second option, you first have to read MIDI format specification.Then you can encode your notes in terms of note on and note off events.
As an additional option, you may consider using other easy to use solutions written in Python and Java at the list of notes to midi conversion stage