CPO adds a few thousand to the value (at least according to my bank)
I would expect to pay 35-36k with 50k+ miles and closer to 40 as the miles drop down.
I paid $39,750 for mine a couple months ago, fully loaded w/ 21k miles fresh out of the BMW Lease Auction. Non-CPO, Just out of warranty, but new PS2's and serviced by the dealer prior to me getting it.
If the car is fully loaded, I would try and get the dealer down to 38-39 for the M3 you're looking at. CPO warranty is nice to have.