I want to remind my readers that my looks at the Oz characters are based solely on Baum's works. This is no discredit to anyone else's Oz stories, I'm simply taking a look at characters as created by their original author.
The Shaggy Man is one of the oddest characters to come to Oz. We're unsure of where exactly he's from. He mentioned he lived in Colorado before Oz, and so did his brother. However, this doesn't mean that's where he's from. Dorothy meets him in Kansas, and he mentions he'd been in Butterfield, which may simply be "Anytown, USA," although it is an actual town in Missouri. (I like to think that it is, given that Missouri's right next to Kansas, and it'd give my home state an Oz connection.) He could be from anywhere, it's possible he and his brother wandered together.
The Shaggy Man featured in The Road To Oz, The Emerald City of Oz, The Patchwork Girl of Oz, Tik-Tok of Oz, and appeared in smaller roles in many other books.
Although other authors have come up with names, neither the Shaggy Man or his brother have names. (One name that I thought was really clever was Shaggy's name being Shaggy Mann. That occurred in Eric Gjovaag and Karyl Carlson's Queen Ann In Oz.) He's only known as the Shaggy Man, Shaggy, or Shaggy Man. His brother is only awkwardly known as the Shaggy Man's brother, or the Ugly One. (Of course, if Shaggy's name is Shaggy Mann, could his brother be Harry Mann?)
Shaggy appears to be a common tramp when he first appears in The Road to Oz, except he seems to be a likable person. He asks Dorothy the way to Butterfield, and she shows him the way, but, as is revealed later, Ozma transports her to a land outside of Oz as she is walking. Shaggy and Toto come along as well. Somehow, Shaggy sends Dorothy on the right road, by telling to choose the seventh road from where she begins to count, telling her that seven is a lucky number for girls named Dorothy. (Obviously, there is also seven letters in the name Dorothy.)
Shaggy reveals his likable nature is due to the Love Magnet, which he carries. He tells Dorothy he got it from an Eskimo in the Sandwich Islands. It makes people love the person who carries it.
Along the way, Shaggy gets to pay homage to Shakespeare's A Midsummer Night's Dream when the king of Dunkiton gives him a donkey's head. Despite this, Shaggy is able to help Dorothy and her new companions (Polychrome and Button-Bright) get to Oz, using his baseball skills from his childhood, and later summoning Johnny Dooit with the Love Magnet.
In Oz, he bathes in the Truth Pond, which restores his human head, but also forces him to tell only the truth. He reveals that he stole the Love Magnet from a girl in Butterfield who had too many lovers. When he took it, only one man continued to love her. Because he is now honest, Ozma allows Shaggy to stay in Oz, putting the Love Magnet over the gates of the Emerald City.
Shaggy appears in a supporting role in The Emerald City of Oz, joining Dorothy and Aunt Em and Uncle Henry (and others) on a tour of the Quadling Country.
Shaggy's next appearance was also brief, though a little more substantial. In The Patchwork Girl of Oz, he manages to rescue Ojo and his friends from the man-eating plants and guides them to the Emerald City, telling them about Oz and offering advice on the way. He leaves the story in the Emerald City.
Next, in Baum's final major use of Shaggy, Tik-Tok of Oz, he is outside of the Nome Kingdom, searching for his lost brother.
It is possible Shaggy and his brother lived together in Colorado for awhile, but at some point, they decided to part ways. Shaggy says in The Road to Oz that he does not care for money, but only for love. As Shaggy's brother became a miner (hmm... does that mean he was his younger brother?), Shaggy may have been repulsed at the quest for money and decided to leave. Still, they are brothers, so when he discovered what happened to his brother, Shaggy knew it was his duty to rescue him.
In Shaggy's adventures, he joins Betsy Bobbin, Hank the mule, Tik-Tok, Polychrome, Ozga the Rose Princess, and Queen Ann and her army, who are set on conquering the Nome King. Shaggy ends up traveling to the other side of the world, gets transformed into a bird, and eventually finds his brother.
Shaggy's brother has been transformed by the Nome King to become ugly, but the female companions help break the spell.
Apparently, now Shaggy's brother is over his lust for money (if it was present), as the Nome King had him imprisoned in the Metal Forest, surrounded by all the gems anyone would ever want. He is alone, without any company, and likely misses his brother.
Shaggy and his brother move to Oz permanently, and do some catching up. After this book, Baum doesn't use Shaggy much, except that he and his brother go search for Ozma when she's missing in The Lost Princess of Oz, and he is part of the rescue party for Dorothy and Ozma in Glinda of Oz.
Shaggy hasn't appeared in many Oz adaptations. He appeared in The Tik-Tok Man of Oz, where he may have been renamed "The Raggedy Man" according to some articles I've seen. He was also in Thundertoad Animation's adaptation of The Patchwork Girl of Oz, which was very much a book-on-screen adaptation. He also had a non-speaking cameo in Disney's Return to Oz.
Shaggy's a great character, despite what odd relationship he may have had with his family. Reliable and trustworthy, he's quite a popular subject of Queen Ozma.