A less obvious example of things "gross" and "rank" can be found in the scene between Hamlet and Gertrude in her chamber. He compares Claudius, Hyperion, to Claudius, calling him a satyr--a rather self-indulgent, disgusting creature in mythology--as far away from Hyperion as one could get. Hamlet also forces his mother to look at herself in a mirror until she recoils from the sight.
In his first soliloquy, Hamlet compares the kingdom of Denmark to an unweeded garden "that grows to seed; things rank and gross in nature possess it merely." This metaphor suggests that Denamrk is not being taken care of under the leadership of the new King -- who so quickly married Hamlet's mother, Queen Gertrude. King Claudius is a weed, and weeds will overtake all of the "goodness" of a garden. At this point in play Hamlet doesn't know that Claudius killed King Hamlet, he is only upset over the almost incestuous nature of the marriage between his uncle and his mother. Denmark is possessed by a disgusting man who needs to be weeded out.
One of the most obvious quotes is spoken by Marcellus at the end of Act 1, sc. 4, when he speaks the often quoted line, "Something is rotten in the state of Denmark." Right after that, in Act 1, sc. 5, the ghost refers to foulness, or rottenness, when he says, in some of his first words to Hamlet, "Revenge his foul and most unnatural murder." In Act 2, sc. 1, when Hamlet is toying with Polonius and pretending to be mad, Hamlet says, in lines 182-183, "For if the sun breed maggots in a dead dog, / being a good kissing carrion - Have you a daughter?" The reference is to decay. In Act 2, sc. 2, when Hamlet is talking to Rosencrantz and Guildenstern, he refers to Denmark as a "...foul and pestilent congregation of vapors," (ll. 307-308). The line suggests a rotten quality to Denmark. After the play, "The Murder of Gonzago", the king goes to his chapel and Hamlet overhears Claudius's words. Claudius begins his meditaions with, "o, my offense is rank, it smells to heaven..." (l.36). The scene in the graveyard in Act 5, sc. 1 also makes reference to bad smells. Hamlet is speaking literally of the smell of decay from the skull of Yorick that he is holding (l. 204), but the whole country of Denmark smells of rot and decay to Hamlet who is still frustrated with himself for his lack of action against Claudius.
Well, the most famous would be Marcellus' line in Act I, scene v, "Something is rotten in the state of Denmark." But there are others. I'd point you to Hamlet's description of Polonius' dead body and what will happen to it as it decomposes in Act IV, scene iii. He tells Claudius that Polonius is "at supper."
Not where he eats, but where a is eaten. A certain convocation of politic worms are e'en at him....[W]e fat all creatures else to fat us, and we fat ourselves for maggots. Your fat king and your lean beggar is but...two dishes.
And in answer to Claudius asking him what he means, Hamlet says:
Nothing but to show you how a king may go a progress through the guts of a beggar.
And in response to the question about where Hamlet has stowed Polonius' body, he says:
But if indeed you find him not within this month, you shall nose him as you go up the stairs into the lobby.
All of this talk about the decomposing and decay of Polonius body relates to the theme of mankind's temporal nature, and the fact that no matter our station in life, we are all destined for the maggots.
The Gravedigger, in Act V, scene i, also waxes philosophical about how dust to dust and the decay of decomposition is a great leveler of mankind.