Yes, this is a matter of projecting the geometry of the buildings onto a shadow plane along the sun angle, and then computing the union of the resulting polygons. This gives a single polygon that you can then get the area of by simple triangle subdivision. All of these features are actually built into your graphics card these days.
If your buildings are non-polygonal and you need a precise answer you're out of luck unless you can model them mathematically, but really that's a rare case these days--everything's built of polygons, and/or you can get away with an approximated answer.
For a specific solution, I'd recommend asking this question on Stack Overflow.