I've done this a few times without meaning to. You have to be really really horny and hard and basically edge until it comes out. It's a strange feeling to cum without orgasm!