There are a number of ways to do this. If you want to add subtitles to a MPG file, probably the easiest way is to use XVID4PSP. You can open up your MPG file, go up to the subtitles pulldown menu and add your subtitle, and then it is just a matter of determining what format you would like to encode your audio/video and hit encode.
If you want to do it directly from IFO/VOB files (rather than converting to a single MPG first), I have tried various programs with decent results (although I seem to always have one complaint or another with them).
1. DVD2SCVD - freeware program that does a very good job at taking ripped DVD files and burning in a subtitle file as it re-encodes. It is an older program and is no longer updated, but it still works. You cannot batch with this program and it does not extract subtitles for you (need to supply srt file).
2. Alldj DVD Ripper Platinum - Need to purchase. Will read subtitles directly from DVD or ripped DVD files and convert to subtitle embedded files (various formats). My biggest complaints with this program is the bitrate settings (at least for MPEG2) don't really seem to work. Max bitrate allowed is 5500 kbps, which would be enough it is actually encoded to that bitrate. Whatever bitrate you chose seems to be ignored (?) or something. When checking output file with GSpot, it is normally more like 2500-3300 kbps.
3. Wondershare DVD Ripper - Need to purchase. Also reads subtitles directly from DVD or ripped DVD files and will convert to subtitle embedded files in various formats. Bitrate setting does work for MPEG2 output (somewhat limited options) but is always outputs the files as 4:3 aspect ratio rather than preserving the ratio from the files. I have been using this program and fixing aspect ratio with VRD...but it is annoying.