This is a jokey, idiomatic statement, usually North American. It tends to mean that the person is odd, remarkable etc. While not exactly negative in meaning - as I said, it tends to be used jokingly - it has a sense that the person is perhaps a bit difficult or their behaviour is eccentric. It is similar to sayings like "You're one of a kind" or "They broke the mould when they made you" except that these sayings are usually more admiring in effect.
I think the origin may be in Shakespeare's Hamlet "What a piece of work is a man!" In Hamlet, it expresses a view common in the Renaissance, that man is the finest of God's creation, "a little lower than the angels" as it is said elsewhere. However, Hamlet is speaking ironically, which may be why the saying also tends to be used in this way.
I think the origin may be in Shakespeare's Hamlet "What a piece of work is a man!" In Hamlet, it expresses a view common in the Renaissance, that man is the finest of God's creation, "a little lower than the angels" as it is said elsewhere. However, Hamlet is speaking ironically, which may be why the saying also tends to be used in this way.