Many ways to go about it, but one common way (and my method of choice) is to place the hops in the bottom of a fermenter that has been rinsed with sanitizer, and then rack your beer onto it after primary fermentation is complete. Dry hopping is one of the few reasons I will personally use secondary. Just note that you don't want to leave the beer on the dry hops for more than ~10 days or so (I never leave them longer than a week) if you are dry hopping at normal fermenting temperatures, or they will impart a vegetal taste (think wheat grass flavor, or the smell of grass clippings). You can leave the beer on the hops if you do it colder (like in your keg at serving temperatures), but that is something you would want to experiment with later.
Many people put their hops in bags, etc. I just let them swim free in the beer. It's pretty easy to rack off them for kegging or bottling afterwords.