When something goes horribly, horribly wrong, this phrase is directed at the aggressor. It can be used either before or after the person/object you're venting at, but not both. Additionally, it can never be used with "you" i. e. one could not say "Get out of my way, you prick of misery."
Person 1: Prick of Misery! The 2 train is running local from the Bronx all the way to Brooklyn. (In this case, the aggressor would be the MTA)
Person 1: You hit me with your car! Prick of misery! (The driver is the aggressor)