this is a very common problem when attempting to record midi and listen to midi output at the same time. As well as what software are you using? also, what soundcard are you using? this happens very often when you are not using the ASIO drivers on soundcards that require the use of ASIO drivers for midi output to be in real time. For example, I am a heavy user of sampletank, if i don't slect the ASIO driver and just use standard windows drivers when i input midi, i experience exacly the same prob as you.
Regards,
Gary Arnold
Creative Director
Wavtracks Royalty Free Music
http://www.wavtracks.com info@wavtracks.com
Wavtracks Royalty Free Music
P.O Box 56, Southgate
Sylvania 2224 NSW
Australia