Try this and see if it's to your liking. You should be able to convert to C++ very easily.
Code:
char ch;
puts("Press any key... ");
scanf("%c", &ch);
if(ch == 'A' || ch == 'a')
// beep code goes here
else
// whatever code goes here
One thing you should note is that this will be calling a scanf function, I believe the equivalent is the C IN (not sure of the code) function in C++.
As far as I am aware, to constantly "monitor" the keystrokes would require some sort of input stream to be created. There are no standard C/C++ library functions to do this. There may very well be ways to do this by invoking the Win32 API, but that's a topic I have no knowledge on.
Hope this helped in some way.