Note: The simplest method of calculating collisions use some method of applying impulses to objects that collide at some point in time. The simplest algorithm is to test if two objects are intersecting at some point in time, and if they are you fix it so that they stop intersecting each other, and then apply the calculated impulses on each object. However, this isn't completely correct. You really need to find out which collisions happened first, step the whole simulation back to the moment of the first collision, and calculate the new velocities right then. This works correctly if you have many momentary and interdependent collisions.
In the worst case, if the particles are dense and come into contact with each other, the easiest method I've found (which is used in this simulation and which I used to handle collision in this simulation) is to use forces instead of impulses. Again you reduce it to a 1-dimensional problem, and have the force of interaction between two particles be:
$$f=-k d-\mu v$$
where $\mu$ and $k$ are constants, $-k d$ is a Hookean spring repulsive force, $v$ is the relative velocity of the two particles along their axis of collision, and $-\mu v$ is a viscous friction force.
I believe that if you want more accurate contact physics (with accurate sliding point contacts instead of a spring force) you'll have to use a much more sophisticated method.