I'm currently using microsoft visual 2010. I know there is a way to produce BGM through c++ but i didn't find any decent guide or tutorial to teach me step by step on how to make it... So can anyone please tell me how to do so?
There are several ways to do this, but not with the standard lib, which means you have to find/use an audio lib.
There are several audio libs available. There are general purpose ones like FMod or Bass. Or you can get easier-to-use but more specific purpose ones like SFML or SDL_mixer.
There's also a way to do it right from WinAPI using the PlaySound function (or one of the other functions in that family) -- though I wouldn't be able to help you with that because I haven't used WinAPI for audio output in like 7 years.