Stick to masking tape or blue tack, drill a small hole somewhere that can't be seen and use a cocktail stick or glue a piece of sprue and snip off after painting.
I tend to favour Mark's idea. Drill a tiny hole somewhere on the part where it won't be seen. Use CA glue to fasten the point of a cocktail stick into the hole. Paint the part. The cocktail stick will snap off when done.
If it's got a small pin to attach it to a bigger piece, try one of those tiny electrical crocodile clips. I've got about a dozen and I use them all the time.
I mostly use small crocodile clips mounted on skewers, but use everything from blutack, double sided tape, ca or hot glue to stick small parts to something I can hold.
Often I'll remove a part from the sprue but leave one of the gates and a bit of sprue attached, so I can hold it with that.
Occasionally I'll use a push pin as pictured below. Heat the end with a lighter and it'll melt its way into the plastic part.