VS IDE finds library exactly same way how command line cl finds it. There are no differences.
So if you would open project properties and add "dsound.lib" to the list in Linker->Input->Additional Dependencies it should work (because you are saying it works in commandline). As long as your VS or Windows SDK setup is not messed up.
Back to the question how does cl.exe finds it. It finds it by looking .lib files in folders that are listed in LIB environment variable. It is documented in multiple places in MSDN, for example:
https://msdn.microsoft.com/en-us/library/6y6t9esh.aspx and
https://msdn.microsoft.com/en-us/library/aa278377.aspx
This variable is set up by "vcvarsall.bat". You can check contents of LIB variable by executing "echo %LIB%" on commandline.