The Tale of Despereaux is a story about a young mouse who acts more like a human than a mouse. Despereaux is in love with the concepts of bravery and altruism. This leads to him falling in love with the human princess in the castle where he lives. The Mouse Council condemns him to death when they learn that Despereaux touched and talked to a human, which is a crime in their community. As a result Despereaux is thrown into the castle dungeon where villainous rats wait eagerly for mice to eat. Despereaux is saved from being eaten when the human jailer in the dungeon decides to protect him because of the mouse's ability for story telling. At this point in the story, the narrative leaves the character of Despereaux for a time to focus on other characters.
This story follows two other primary characters besides Despereaux, even though the story is named after him. Roscuro the rat and Miggery Sow both have their own storylines told initially independently of Despereaux's.
Roscuro, who lives in the pitch black dungeon, was exposed to almost blinding light as a young rat and becomes obsessed with finding more light thereafter. Roscuro eventually finds his way into the upper levels of the castle, which are full of light, and secretly attends a royal banquette. He is spotted, however, by the young princess and the shock causes Roscuro to fall into the queen's soup. The queen dies of fright and rats and soup are outlawed in the kingdom. Roscuro, crushed by the loathing and hate he experienced, slinks back to the dungeon and becomes a creature doomed to be torn between light and dark, perhaps for the rest of his life.
Around this point in the book, the story switches over to following the character of Miggery Sow, a young girl who was sold into servitude by her father. Miggery Sow is unfortunately lacking somewhat in intelligence, according to the story, and she suffers from extremely bad hearing due to the physical abuse she experienced at the hands of the man she was sold to. When one of the kingdom's soldiers realizes that she is a slave (in a kingdom where slavery is forbidden) he takes her to the castle to work for money for the first time in her life. Miggery's greatest wish is to become a princess and to never have to work another day in her life and it is this desire that Roscuro takes advantage of.
Roscuro wants revenge on the princess, who spouted hateful things about him and made him feel like a monster, so he uses Miggery's lack of intelligence and her wish to be a princess as a way to achieve his vengeance. He claims that he can help Miggery kidnap and switch places with the princess and promises that no one will be the wiser, a proposition that Miggery gladly accepts. However, Roscuro's devious plotting is overheard by Despereaux and the mouse decides he must do the heroic thing and save the princess.
Despereaux's return to the light is all but pleasant as he gets his tail cut off and all his attempts to warn people that the princess is in danger fail. Despereaux does, however, reconcile somewhat with his father, who betrayed him to the Mouse Council. Eventually, though, Despereaux recognizes that he must go and rescue the princess himself, who at this point has already been kidnapped and taken to the dungeon. After receiving a full belly of illegal soup from the kitchen's cook, Despereaux returns to the dungeon and, with the help of a sadistic rat, finds Roscuro, Miggery and the princess.
By this point, Miggery has begun to realize that Roscuro lied to her and never intended to make her princess or give her a happy ending. Despereaux reaches them and, after Miggery accidentally cuts off Roscuro's tail, threatens the rat with a sewing needle held to his throat. Roscuro begs for death, however, when he smells the soup on Despereaux, the same soup that was being served on the day that he accidentally killed the queen. Roscuro admits that all he wants is some light in his dark life. The princess manages to forgive Roscuro and offers him some of the delicious soup that had been far too absent from their lives. Together the two humans and the mouse and the rat journey out of the dungeon and find some soup. After this all of the characters receive varying degrees of happy endings and the story ends.
I am including a reference link to the Enotes summary page which includes more specifics and greater details.