National Electrical Code 2014
Article 250 Grounding and Bonding
II. System Grounding
250.24 Grounding Service-Supplied Alternating-Current Systems.
(A) System Grounding Connections. A premises wiring system supplied by a grounded ac service shall have a grounding electrode conductor connected to the grounded service conductor, at each service, in accordance with 250.24(A)(1) through (A)(5).
(1) General. The grounding electrode conductor connection shall be made at any accessible point from the load end of the overhead service conductors, service drop, underground service conductors, or service lateral to and including the terminal or bus to which the grounded service conductor is connected at the service disconnecting means.
This means that the grounded (neutral) from the service must be connected to ground, and that the connection can be made by bonding the neutral bus bar to the grounding electrode.
(5) Load-Side Grounding Connections. A grounded conductor shall not be connected to normally non–current carrying metal parts of equipment, to equipment grounding conductor(s), or be reconnected to ground on the load side of the service disconnecting means except as otherwise permitted in this article.
This means that the grounded (neutral) conductors should only be grounded at the main service disconnnect.
If the main service panel happens to be the same place that the grounded (neutral) conductor is bonded to the grounding electrode, then there is no problem mixing grounds and neutrals on the same bus bar (as long as there is an appropriate number of conductors terminated under each lug). If the two bus bars are not connected; as would be the case anywhere other than the main disconnect (exceptions exist), then you cannot mix them.

Notice how the grounded, and grounding bus bars are connected in the main service panel. This means that; electrically speaking, they can be considered a single bus bar. Which means that both grounded (neutral), and equipment grounding conductors can be terminated on either bus bar.
In the subpanel, the bus bars are kept separate. So grounded (neutral), and equipment grounding conductors cannot be mixed.