If MIDI notes are being recorded with latency try checking the 'Use system timestamp' box in the MIDI Port Setup page in Cubase 4 Device Setup (it is on the 'DirectMusic' page in Cubase SX2/3 - this option will not appear if you are not using at least the latest version of Cubase SX2). This switches the timing reference for MIDI. More information on this can be found here, including a link to a program that can determine which is the most stable timing reference on your computer.
If there is still a problem then try comparing the emulated DirectMusic (DM) ports and the standard WDM ports to see if you get the correct performance out of one or the other. The emulated DM ports will appear as 'ReMOTE [emulated]' in the Cubase MIDI input and output lists. If you do not see this as an option then the emulated ports are filtered. You can re-enable the filtered MIDI ports by following these steps:
1. Browse to the Cubase program folder (usually C: Program FilesSteinbergCubase 4) and locate the folder "MIDI Port Enabler"
2. Open this folder
3. Pick the file "ignoreportfilter" and move it into the Cubase program folder (one directory up)
4. Start Cubase
Now all available MIDI ports provided by the MIDI interface driver will appear in Cubase.
Be aware that the ReMOTE will now show up as a MIDI device 2 times in Cubase. Selecting 'All MIDI inputs' will result in double MIDI notes being recorded from both the Windows MIDI driver and the emulated DM driver so only select a single MIDI port as a track MIDI input or configure the 'All MIDI Inputs' in Device Setup first.
More info on emulated DM ports can be found here.