The 40d body is more robust than the 400d (we have 400/50/20/10d bodies in our household). The 400d is a quite a lot smaller and dare I say less 'serious' as far as build quality is concerned, they are fine but I dont think it (400) will last as long as the others, could be wrong. The men in our house dont like the 400 as its too small, my wife prefers it, which is why we bought it, plus its light weight. I doubt there is any real difference in image quality between either the 400 or the 40, so I'd try both and see which you prefer.
Your budget will need to be stretched if you want 'good' portrait and macro lenses. My 100 2.8 macro was approx £400 on its own.
Matt