I'm fairly certain that, at least on most modern machines, the display mouse cursor is updated at the device refresh rate, and no faster. So in theory you should be able to have the mouse cursor locked to your drag. However, if I had to guess (without looking at your entire program in more detail), I would say that the problem could be when you are calling GetCursorPos() as compared to when Windows is able to look at the latest mouse cursor position.
When Windows is updating the movement of a window, it can obviously make sure that it does not update where it thinks the mouse cursor is after that before submitting the final composite for that frame to the GPU. But you don't know when that is happening. So it's pretty easy for you to have a one-frame lag between where you think the cursor is and where Windows draws the cursor - all that has to happen is that Windows has to update the cursor position in between when you called GetCursorPos() and when it submits that frame to the GPU. Does that make sense?
So typically what you want to do is draw the cursor yourself while it is in your window, which avoids this potential visual lag, if that makes sense. Because I don't know that there's much you can do to ensure that you are always right in line with the cursor rather than a frame behind - really the only thing I can think of is timing the vertical blank and trying to push your processing to be at the last possible instant before the blank, but that sounds very error-prone to me.
All that being said, this is not something I've ever looked at personally before, since games always draw their own cursors, so it's never an issue...
- Casey