If I'm assuming correctly, you're doing this in a console mode program. Your problem is, DirectInput is returning the exact pixel where you clicker. Console mode programs don't work that way, they work in characters. A character (unless you have your console font set to bigger than usual) is 7x12 pixels. Therefore, you have to add 7 to the x value that it returns to you and add 12 to the y value. That should work.
If I assumed incorrectly and you're not in a console program, ignore this .

Brendan