On a crop body, the 17-55 has a more useful focal range and has IS, which is supremely useful in handheld low light. The 24-70 is larger, heavier, and weather sealed. Image quality between the two is a wash.
The 17-55 is sharper wide open and more prone to various types of flare.
The IS works great. The range is better for all-around work on a 1.6 cropper.
The 24-70L has better bokeh (really superb bokeh, actually) and a very useful
close focusing capabiltiy, rendering it fantastic for flower shots, provided you're
not looking for 1:1 macro focusing. It's color performance and overall look are
more pleasing than the 17-55, but it's not as sharp, and in landscape scenarios
you may be wishing it gave you a little more resolution. That said, for smaller sized
prints, landscapes can still look great.
My recommendation, if you are sticking to your 40D for now, would be to get
the 17-55. But for weddings the 24-70L has a great focal length range. [The L zoom
makes a great portrait zoom on 1.6 crop.] Tough decision, but I'd still go for the
17-55.