Go to: Winamp -> Prefs (Ctrl+P) -> Playback -> Replay Gain tab
Make sure "Use ReplayGain" is checkmarked.
The "Preferred source" setting determines whether to use Album or Track gain mode.
The RG values are written to the file tags only. No audio data is modified.
If you remove the values or the tags, then the (playback of the) file is restored to how it was before.
Applying RG in foobar or Winamp should yield virtually the exact same results.
The only difference with foobar is that you can configure it to write metadata to APEv2 tags for mp3's, whereas Winamp 5.51/in_mp3 doesn't currently see/read APEv2 tags (although we plan to implement APEv2 tag support at some point in the not too distant future). So for now, make sure foobar is configured to write to ID3v2 tags, not APEv2. Or just use Winamp instead :-)
The configuration for Winamp's RG Analyzer (right-click items -> Send To -> Calculate RG) can be found via: Winamp -> Prefs -> Plugins -> Media Library -> ml_rg.dll -> config.
More info here: