In 2004, the probe called Stardust swung by a comet called Wild 2, stuck out sort of a big catcher's mitt--I think it looks more like a tennis racket--and hopefully it picked up some of the particles thrown off by the comet.
NPR: Stardust Set to Deliver Comet Samples