Hazel,
Delay in midi is a function of the soundcard's latency; one of the reasons I prefer composing midi to an external module is to mitigate that latency. However, the system can be tweaked to bring midi latency to an absolute minimum, if not eliminate it altogether.
One of them, as I previously stated, is to use external modules. Software will always have latency until we can have processors operating in the hundreds of gigahertz range. While I sometimes do midi with Cubase, I have fallen victim to notes leading and lagging the beat. The ignoreportfilter and miditime utility helped in identifying the tweaks necessary to correct midi timing. This was mostly because Windows Midi and Directsound had different timestamping methods on the midi stream, the
Jay Levitt miditime site can fully explain the whys better than I can.
Another thing is to use the soundcard's direct monitoring capabilities. I never monitor thru the software whenever I'm tracking. I leave that for later when I'm already in the mixing process. Some usb midi interfaces also have a problem with midi jitter causing inaccurate midi timing, it is sometimes recommended to use serial or parallel port midi interfaces - the old Opcode interfaces and some Motu interfaces have this. PCI midi interfaces were reported by SoS to have the most accurate midi timings of all.