Saturn's Children by Charles Stross

This is an earlier Stross novel. The setting is incredible - humanity creates lots of robot (sex/manufacturing/utility) slaves, and eventually they become such good replacements of humans that nobody has kids anymore. Then (almost by accident) humanity dies, and the sentient robots are left alive.

It has some incredibly great scenes, ideas, and characters. A whole society of robots build for various functions, all restrained by their in-built rules, but trying to bend them to survive. I totally loved it. I just love anything Charles Stross writes. It's so interesting, really great understanding and depth of thought and consequences. Once the plot starts rolling in this one it is incredibly exciting - a perfect setting, and an epic idea within it.