Like others, I dry hop with pellets and just put them in the secondary, as is, no washing, etc, and without a bag. Then I rack the beer on top.
However, when it's time to bottle, I use a large, fine-mesh laundry bag I got at Bed, Bath, and Beyond that works positively great. It's large, so it more than lines the bottling bucket, and it has a draw string that lets me secure it to the outside of the bucket.
Basically, I wash it well and then I sanitize it for a good while (while I'm preparing the rest of the things I need for bottling). I then line the bucket with the bag and rack the beer, very carefully to avoid a) aerating the beer and b) picking up floating stuff from the fermenter (Why be careless even when using the bag?). When I'm done racking, I just remove the bag, again very carefully.
Positive things about this are: 1) the fine mesh retains any stuff that makes it out of the fermenter, 2) it avoids having a bag inside the fermenter, exposed to the beer for many, many days (not that there is anything wrong with that if you follow good sanitation practices), 3) it avoids the work of having to take the bag full of hop particles out of the fermenter.
As a plus, in between bottlings, I use the bag to put my dirty laundry.
Here is a
pdf scan of the packaging of the bag if you decide to check it out.
Good luck!