As Mario, stand on the sun platform in the middle of the main room in the castle and look up at the sun above the final Boss door. Inside, collect eight red coins and a Star will appear on the center platform. Note: You can only access this star after you reach a certain point in the game. You will know you have reached this point when the sun shines through onto the platform.
Go into the courtyard but, instead of going into Boo's Big Hunt, go to the red bricks on the side and Ground Pound them. One of them will have a hole leading to a secret stage where you must collect five silver stars.
On the level where you unlock Wario, when you get down the slide and across to the land, turn left to see a narrow little bridge that leads to another area. Get the Wario hat nearby, then get the Power Flower to become Metal Wario. This is necessary because the wind blows when you try to cross. Crush the big black cube to get the Star.
The door that is next to Wario's door contains a Star in it. The only way to get it is by catching all the shiny bunnies. The last bunny will give you a key to use on the door.