Are you trying to hard code the subtitles (i.e. add them to the image)? Or are you trying to add subtitle tracks that a viewer can turn on and off like DVD or Blu-ray subtitles?
If it's the latter, that's tricky. If it's the former, there are a lot of good tools available. If you are working in Creative Suite, pt_Import_Subtitles is a great tool that works through After Effects. The only limitation I've found is that is chokes on subtitle text files (I use SubRip files) larger than 2MB, so you have to split up the subtitles for import. If you need to convert your files to SubRip or Encore for pt_Import_Subtitles, SubtitleEdit is a great freeware application for this.
I have also tried out hard-coding with VirtualDub. It works pretty well, and you could make an intermediate file with the hard-coded subtitles using a lossless codec like UT or Lagarith. You could then send the intermediate file to your encoder to make the H.264 file.