You'll have to unforbid them in order to milk them. It helps to put your milking station in a remote corner of your fortress, ideally next to the chasm where you're catching them to begin with, and lock your milker inside while he works - dwarves only eat trapped vermin if they're the closest food available, so you'll really only have to worry about your milker eating the maggots while milking them (which can be solved fairly easily by putting a small food stockpile nearby, preferably meat for baiting animal traps to catch even more maggots).
Incidentally, if a dwarf does pick up a purring maggot and claim it as a meal, simply Forbid it and he'll drop it on the floor, where it will roam around like a normal vermin. At this point, make sure all empty animal traps are nearby (with the bait and the milking room right next to the chasm, it makes sense to keep the empty traps there too, though make sure there aren't any others available) and issue a "Capture a Live Land Animal" task from a random Kennel - your trapper should head toward the nearest empty animal trap (which should be near your milking room) and try to capture the nearest visible vermin - the purring maggot. Once recaptured, it will no longer be owned by a dwarf and can be safely stored for milking.
One thing I noticed while milking in my fortress is that milked maggots will not be removed from the Farmer's workshop and placed back into animal traps when they're done - you must build a cage for them and assign them to it. This also makes it very easy to protect them - just d-b-f to forbid the entire cage when milking is done and you're all set.