I bought a MIDI keyboard for my birthday. I found a program (MidiPiano) that gets signals from the MIDI input and translates it into music, but I\'d rather like to write one
Use the C# Midi Toolkit to receive the midi information from your keyboard (connected to the midi in-port of you audio card). To create audio (music or tones) you need to generate a continues stream of digital audio data. You could start with the C# Synth Toolkit (same author as the midi toolkit) to write your own synth.
But you could also download a free (open source) sequencer program (audacity for instance) and use VST instrument plugins to do the job for you. There are a lot of free plugins available on the web.