Add class to last 3 posts in loop

WP_Query seems to set two variables, $posts and $post_count when running(according to the source over at http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/query.php ). You can access these two and work something out to figure out if you’re in the last three posts.

var_dump those two to see if there’s a count, add in your own counter and you should be good to go.

Edit: it’s actually $post_count and $current_post that will be useful to you.