I suppose you mean column names with headerline. Here a small example:
set.seed(123)
## create example matrix
m <- matrix(runif(200), ncol=10)
## create column names (A-G)
colnames(m) <- LETTERS[1:10]
## calculate distance matrix (transpose matrix, because dist use rows as individual samples)
d <- dist(t(m))
## clustering distance matrix
h <- hclust(d)
## plot it
plot(h)