Acquire a MIDI port for the computer. By default, computer systems do not have a MIDI connection port. However, there are many options for getting one. The ubiquity of USB has spawned simple conversion devices that translate MIDI data into USB. They do not require special hardware or complex installation processes. Alternately, a MIDI input card can be installed in the computer. This is a more robust and permanent upgrade.
Purchase MIDI cables. These are standard cables with identical connectors on each end. It is possible that MIDI cables will be included with the MIDI port you acquire. You will need two MIDI cables for a keyboard. One serves as the output, while the other receives data from the computer.
Download and install MIDI software. The industry for electronic music software is vast. Some powerful programs cost hundreds and even thousands of dollars. However, many are available for a free demo. A particularly excellent option is the Reaper program, available for free download.
Connect one MIDI cable from the computer's MIDI output port to the MIDI input connector on the MIDI keyboard. Do the same for the other cable between the computer's MIDI input and the keyboard's MIDI output.
Turn on the computer and run the MIDI software. The computer is now ready to interact with the MIDI keyboard.