You have a few different options depending on the desired response time from your incoming counter to when you send the TTL signal.
I would take a look at the examples in the Counter and the Digital folder here (assuming you have the DAQmx driver installed):
C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\
CTA, CLD, MTFBWY