what kind of software you use for computations? If use R for example there are tutorials for machine learning (included k-means clustering) with R examples. For Matlab I am sure there are similar ones.
Basically k-means is about distances between variables. It could be Euclidean distance but there are other available. In R for example user chose type of distance and number of clusters.
another great lecture from slideshare, about machine learning:
In a nutshell, it is a family of methods to take a set of data points and partition (cluster) them into k different categories. Each datum D can be function of many variables, for example a function of 3 variables would be D = D(x,y,z). In a sense, the algorithm looks at these spatially (like points in space) finds subsets of them that minimize the within-cluster variance of some measure, often the distance between points. There are many other methods of clustering too...this is just one of them.