Variance is defined as $V(x)=\frac{\sum_{i=1}^n(x_i-\mu)^2}{n}$. Just in case for you, mean $\mu$ is defined as $\mu=\frac{\sum_{i=1}^nx}{n}$. Covariance between two random variables $x$ and $y$ (or columns of a matrix) is defined as $Cov(x,y)=\frac{\sum_{i=1}^n[(x_i-\mu_x)(y_i-\mu_y)]}{n}$ and $Cov(x,x)=V(x)$.
The term covariance matrix may be misleading to you. It is not any sort of a special matrix. It is simply set of variances and covariances between pairs of columns. A position of any element in the covariance matrix corresponds to variance/covariance between a pair of two columns, e.g. a number located in 3rd row and 2nd column in the covariance matrix represents covariance between 3rd and 2nd columns of matrix $\textbf{A}$. $Cov(x,y)=Cov(y,x)$, therefore covariance matrix is symmetric.
If you have a matrix $\textbf{A}=\{\textbf{x}\;\textbf{y}\;\textbf{z}\}$ while $\textbf{x}$, $\textbf{y}$, and $\textbf{z}$ are column vectors of length $n$, covariance matrix can be calculated as follows:
$Cov(A)=\begin{bmatrix}
\frac{\sum_{i=1}^n(x_{i}-\mu_x)^2}{n} & \frac{\sum_{i=1}^n(x_{i}-\mu_x)(y_{i}-\mu_y)}{n} & \frac{\sum_{i=1}^n(x_{i}-\mu_x)(z_{i}-\mu_z)}{n} \\
\frac{\sum_{i=1}^n(y_{i}-\mu_y)(x_{i}-\mu_x)}{n} & \frac{\sum_{i=1}^n(y_{i}-\mu_y)^2}{n} & \frac{\sum_{i=1}^n(y_{i}-\mu_y)(z_{i}-\mu_z)}{n} \\
\frac{\sum_{i=1}^n(z_{i}-\mu_z)(x_{i}-\mu_x)}{n} & \frac{\sum_{i=1}^n(z_{i}-\mu_z)(y_{i}-\mu_y)}{n} & \frac{\sum_{i=1}^n(z_{i}-\mu_z)^2}{n}\\
\end{bmatrix}=$
$Cov(A)=\begin{bmatrix}
V(x,x) & Cov(x,y) & Cov(x,z) \\ \\
Cov(y,x) & V(y,y) & Cov(y,z) \\ \\
Cov(z,x) & Cov(z,y) & V(z,z) \\ \\
\end{bmatrix}$