Asymptotic normality of interpoint distances for high-dimensional data with applications to the two-sample problem