What are some good tips for riding in a large group?
Group rides of this size and speed often consist entirely of racers. If a steady double paceline hasn't formed, then to be more specific, this is one of those rides that is, in effect, a race itself.

So with that in mind, so some general thoughts about these types of group rides:


If they are all wearing the same jersey and you are not, ask permission to join in first.
Keep the same line as the rider in front of you in turns. 
Practice bumping shoulders and hips with some friends on a soft, grassy field so the first time you take an inadvertent bodycheck isn't at 35mph.
Protect your front wheel. Your invisible wheel fairies live within a foot or so of your front wheel. Do not let anyone else's wheels steal them.
That said, do not stare at the wheels in front of you, look up the road, hips of the rider in front of you is often a good place to look for distance.
You probably want to, if at all possible, be at the front, but not on the front. In a group of 30-40 riders, this means probably in the top 10 or so. Note that everyone else wants to be here.
Do not take it personally if you get yelled at. Contemplate what you did that caused yelling and endeavor not to do it again.
Get more speed. Racing is more about dealing with high speed surges where you have to ride at 30+mph while Exciting Things Happen than it is about keeping a good average speed. Try to stay on and sprint as hard as you can when things get fast until you get dropped. You will get faster.
If you are not yet comfortable, there is nothing wrong with hanging out at the back, suffering and watching how the ride unfolds. It takes a while to get comfortable riding close to other guys at these speeds. Take it easy, it's safer for everyone.