The problem you are having is a standard and well known problem. The Midi protocol consists of several parts:
Basic:
1. Note on, Which note (0-127), Velocity (0-127)
2. Note Off, Which note (0-127)
your Keybord is not getting the "note off" signal, and thats why the note is hanging...This could be due to a problem with your midi interface especialy if you are using the "Joystick Port" or an older interface. The buffer gets overloaded and misses a "note off" out. So what can you do? My advice if you are using "Joystick Port" or an older interface, throw them in the bin and buy a new one. If you have a relativley new one then check settings or get the latest version of the driver for the interface.
Hope this is of some help.