You can throw them right in or use a bag. This is true for both during the boil and for dry hopping. I think you'll get opinions from different people which they prefer - it is just that, person preference.
If you want to use leaf and limit the amount of "hop gunk" then I would suggest using a bag to contain the hops. Once finished,you can just pull the bag out.
Some words of caution:
- make sure you have enough space in the bag (not packed too tightly) so all of the hops can be utilized
- If dry hopping in a bag, make sure the sanitize the bag prior to adding it to your beer
- Leaves tend to float more than pellets - not a big deal during the boil, but in dry hopping, you may need to add some weight to the bag to get the hops to have better contact with the beer. People use clean and sanitized marbles/washers etc.
- If dry hopping in a carboy, leaves can be a pain in the neck (literally). Once they absorb the wort, it can be hard to get them out of the carboy since the neck is small. In a bucket, this isn't really an issue
- Make sure to check the AA% of the hops in pellet form vs. leaf to ensure you're getting the correct bittering addition during the boil for the hops you have.
I personally like pellets because they take up less storage space. I just throw them into the kettle/primary. I strain the wort into the primary and siphon carefully out of the fermenter. Cold crash and a fining with gelatin and I get crystal clear beer. I probably lose a negligable amount of finished beer to "hop gunk" compared to using a bag and leaves.
Choice is yours, and there really isn't a right or wrong way.