You could use flow control pins to acchieve it.
But...at big rate, serial and parallel port doesn't have precision.
I reached better precision, implementing an external board ( with crystal oscilator ) to generate timming to interrupt PC software.
You can generate a signal directly from your PC using the sound card- I am not sure if that is what you want to do.
Check this out: **broken link removed**
If you indeed want to set the waveform outside the PC you will of course need an external waveform generator. You either have to build one, in which case you then get to define the communications protocol before you start, or you can use a commercial waveform generator. Agilent is one name that comes to mind.
I describe an arbitrary waveform generator based in Excel that communicates over RS232 (direct from Excel) with a Stanford Research Systems DS345 in my book
Excel by Example : A Microsoft Excel Cookbook for Electronics Engineers
published by Elsevier/Newnes
ISBN-10: 0750677562
ISBN-13: 978-0750677561