To do this, you can modify the Application's Info.plist file. To get to this file, either cd into the Application (Apps are just directories) or, in Finder, right click on the app icon and choose "Show Package Contents". Then edit the Info.plist file in your favorite text editor (Or the Property List Editor if you have it installed) and add the following text (or add in the appropriate key/value in Property List Editor).
<key>LSUIElement</key>
<string>1</string>
Note that not only does this hide the dock icon, but it also hides the menu bar. Unfortunately I don't know of a way to only hide the dock icon.
Source, yes, it's old, but presumably it still works. Let me know if it doesn't.