Greetings,
The NI Development Library has hundreds of examples that will get you started with your application. Additionally, when you install the NI-DAQ driver and select that you want Visual C/C++ support, examples will be placed on your hard drive. Look in \Program Files\National Instruments\NI-DAQ\Examples\Visual C. If you don't see this directory then you will have to re-run the installer for the NI-DAQ driver and add these examples.
I assume that X and Y are analog signals that you want to acquire simultaneously. Look in the "ai" directory for examples on analog input.
Development Library
http://zone.ni.com/devzone/devzone.nsf/6ae7945502d89dea0625685500506e1f/4d58b1b80ec41ef70625683f006e1d6d?OpenDocument
Regards,
Justin Britten