My two cents worth..... We always install the base trim and door trim first. If you have split jam doors with the casings already attached, you must install them first or you will have a real problem fitting the jams to the floor between rooms. As mentioned, sometimes the carpet installers can scratch the finish on the baseboards, however it is usually minor and easy to touch up after. The problem I see with putting the trim on last is that depending on the style and thickness of the carpet and pad, you can have a bit of a ridge over the tack strip. Of course you can nestle the trim down into the carpet, but some of the bottom square edge of your trim may still show. It is also much more difficult to maintain a level line and make splices on longer runs. If the corners are not perfectly aligned, then coping the base won't match properly. Since the trim should outlast the carpet, anytime you need to re-stretch the carpet or remove it, the trim will have to be removed first as it is impossible to do either with the trim in place. Now that is an absolute nightmare and rarely will you be able to salvage all the trim to re-install.
My advise, install the trim and doors first and stress to the carpet installers to be as careful as possible. You can also put a strip of 2 inch delicate work painter's tape on your trim before the carpet goes down. Leave about a half inch at the bottom of the trim uncovered, then remove it after the carpet is installed. This will help prevent some of the minor scratches the edge of the carpet can cause before it is chiseled behind the tack strip.