Do you want your keyboard to act like a musical keyboard? (Or even plug a real keyboard in?)
(like Virtual MIDI Piano Keyboard http://sourceforge.net/projects/vmpk/ )
You need to use some sort of multimedia library in that case.
There are a number of cross-platform libraries including OpenAL, SFML, and FMOD. See links below for further information/search this site (and the web) for opinions.
If you're running on Windows, you also have the old WINMM API (which is the easiest to use of the Windows API's.) Plus DirectShow, Media Foundation, and XAudio (the successor to DirectSound and XAudio.) With the WINMM API you can play a background file using either the PlaySound() function or the mciSendString function.