It would be a lot easier if you build your instrument first, even if it just generates a "simple" tones. Or, build a MIDI device first with "simple switches", and then add your infrared sensors/interface.
About 99% of the time a MIDI instrument is a keyboard. It's going to have a synthesizer built-into the instrument so you can play it without using the MIDI interface, and you'll be able to upload (to the instrument) various instrument-sounds.
You can also send MIDI commands from the computer to the instrument so that the computer is playing the instrument. And, you may be able to load a MIDI file/sequence into the instrument to automatically play the instrument with no computer attached.
You can send MIDI commands from the instrument to the computer while you are playing to "capture" the performance/commands for playback/editing later. When you play-back the MIDI file, you can play it back with a different instrument-sound.
You can play MIDI files on your computer, and with the appropriate software you can edit the files.