Seems to me that you want to use the SendInput function. It simulates everything (keyboard and Mouse events). Basically you just fill out an INPUT struct, pass it in and watch it go.
NOTE: a Click is essentially a Mouse DOWN event followed by a Mouse UP event. If you dont send a Mouse UP event then your cursor will be treated as having the mouse button down.
memset(&mouseInput, 0, sizeof(INPUT));
mouseInput.type = INPUT_MOUSE;
// Move a mouse Cursor
mouseInput.mi.dx = newMouseXCoords;
mouseInput.mi.dy = newMouseYCoords;
mouseInput.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
// Fire Event
SendInput(1, &mouseInput, sizeof(INPUT));