1. direct use HiV mos + BJT
but as I know some process BJT model have problem is HV
2. use 2 step regulator
40v -> ~12
then use 12v device make bandgap is easy than 40V cmos
40V CMOS L is very large ...
for good Line regulation need Long L
what process in your design UMC/TSMS/VIS or other ??