Hello Dave,
You are probably getting that error because you are starting the task twice, and this cannot be done. You can actually find examples that does exactly what you want in the following folder:
...\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples\DAQmx\Counter\Generate Pulse
hope this helps,
LA