They are used pretty much like the nouns they stand for.
Subject: Your flat is wonderfully spacious; mine is much too small.
Direct Object: Luke and Emma went to the fancy dress party as Punch and Judy. His costume was pretty dull, but I loved hers.
Indirect Object. Peter and Mary have very different sons. I gave his a book for Christmas, and hers a chemistry set.
Object of preposition: I was impressed by Henry's speech - and by yours, Jack.