Large-scale pairwise similarity calculations of vectors
Not so much about performance. The cosine similarity can be expressed in a more concise (and maybe even more performant) way with STL:

dot_product = std::inner_product(v1.begin(), v1.end(), v2.begin());
ss1 = std::inner_product(v1.begin(), v1.end(), v1.begin());
ss2 = std::inner_product(v2.begin(), v2.end(), v2.begin());


This of course assumes that the vectors are of the same size.
Since you want it for every pair of vectors, nothing can be done to speed thins up algorithmically. There are \$O(n^2)\$ pairs, so the performance is bound to be quadratic.
cosine_similarity works with each vector many times, and recomputes its length (ss1/ss2) many times. Compute them all in advance. It is probably the biggest performance gain you can achieve.
There is no need to pass vector_size by reference.