you use the Mixer API to do this, but it can be a real tear your hair out experience trying to work out which the right mixer control to tweak is.Code that works on XP doesn't work on Windows 7 and vice versa. My best attempt so far can be seen in the source code for the .NET Voice Recorder. See the TryGetVolumeControl function here:
http://voicerecorder.codeplex.com/SourceControl/changeset/view/f652f98eb1ff#VoiceRecorder.Audio%2fAudioRecorder.cs