Before you think about stuff like which microcontroller to use, do the sensible thing, run the numbers.
If I got my math right then 1 count (aka the last digit) in 40000 is 25 ppm. Can you construct a resistive divider that good?
For example, lets assume one of your resistors is perfect, and the other is just 0.05% off, and the meter is perfect, too. Then you end up with a display of 39.990 V for 40.000 V input (or 40.010 V - i.e. overflow).
Now you might be lucky. You might get two resistors from the same lot which happen to have a similar error in the same direction, canceling each other's error out in the resistive divider. But do you feel lucky?
And if you aren't lucky, do you have the instruments to adjust the divider, or do a correction in software?