A good example that will help get you started is STCgenerateSquareWave.C. This example is located in C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ctr. I also found a tutorial about counters that you may find useful. Here is the link: Generating a pulse train with a counter.
A function that could help you with this application is the GPCTR_Change_Parameter function. Further details about the function can be found in the Traditional DAQ C Function Reference Help. This is located in Start>>All Programs>>National Instruments>>NI-DAQ.
I hope this information helps you with your application.