I know most people don't have enough closet space, but if you're willing to sacrifice a closet,here are some pretty nifty suggestions from apartmenttherapy.
Here is a link that might be useful: uses for your closet
That first one looks like a closet in this house. When we bought the house (foreclosure) there was a trundle bed in the closet with a shelf and closet rod over it like that.
Our previous home (100 yr old large Arts & Crafts) had huge closets in all the bedrooms. Two of the closets were 9X17. We didn't use those bedrooms, and guests certainly didn't need that much closet space. So one was turned into a bedroom for our grandsons (bunk beds), and the other I used as a sewing/craft room. Both closets had windows and it was a much better use of the space than leaving them with clothes rods and shelves with nothing in them.
My grandparents use an extra bedroom as a TV room and they have their desk in the closet in there. Granted, theirs isn't as pretty as your example. I always thought it was a neat idea since desks tend to get cluttered. My grandma just shuts the closet doors when she has unexpected guests. I also like that it doesn't take up space in her guest bedroom or formal living room, which is valuable in a small house.