Like I said, $40k is middle class, not wealthy. Middle class doesn't mean living below the poverty line. But I didn't think you meant being middle class is living extravagantly, maybe I was wrong.
I think the California state minimum wage is still $11.50 (maybe one of our fellow Californians can corroborate that as right or wrong), but the local minimum wage was raised to $12.50 I think this past January or something. But I make more than minimum wage, and work 40 hours a week, and get a lot of overtime and double time. Just because you think working 40 hours a week is unthinkable, doesn't mean everyone does (that was funny the post to benji above where you seemed incredulous that he must work at least 40 hours a week).
Entry level programmers fresh out of college make an average of about 60k here. Naraku is in cyber security if I remember correctly, and he's well out of college and has been in his field for a while.
My dad worked in sales his whole life, and not as a manager, and he still cleared $150k for a good portion of his career. In retirement he makes an average of about 70k, including his investments. And no, we don't live in a mansion though you'd probably think this house is a mansion.