Here is a down-to-earth cohomological interpretation of the usual linking number.
Let $M$ be an oriented manifold (possibly non-compact) of real dimension $p$ and let $X\subset M$ be a closed subset, the support of a codimension $q$ Borel-Moore cycle $c$ homologous to 0 in $M$.
An example: take $X$ to be a pseudo-manifold in the sense of Goresky-MacPherson, Intersection theory 1 (informally speaking, a manifold with singularities of real codimension $>1$); then the fundamental class of $X$ is well-defined and we require that it should be homologous to 0 in $M$. To be more specific, we can take $M=\mathbf{C}^n$ and $X$ a closed complex analytic subvariety of complex codimension $q/2$.
Suppose $H_{q-1}(M)=0$. Then the group $H^{q-1}(M)\cong H_{p-q+1}^{BM}(M)$ is finite (we use the universal coefficients formula for this and $H^{BM}$ stands for the Borel-Moore homology), and
$c$ defines (via the Poincar\'e-Lefschetz duality) a unique element of $$H_{p-q+1}^{BM}(M\setminus X)/\mbox{torsion}\cong H^{q-1}(M\setminus X)/\mbox{torsion}.$$
Here is another equivalent definition: suppose that $c$ is represented by a smooth singular chain $\tilde c$, and consider the function $H_{q-1}(M\setminus X)\to\mathbf{Z}$ defined
as follows: take a cycle in $$H_{q-1}(M\setminus X)=\ker(H_{q-1}(M\setminus X)\to H_{q-1}(M)),$$ represent it by
a smooth singular chain $z$, find a smooth singular chain $w$ in $M$ that is bounded by $z$ and transversal to $\tilde c$, and calculate
the intersection index of $w$ and $\tilde c$. This function also defines a unique element
of $H^{q-1}(M\setminus X)/\mbox{torsion}$, which coincides with the above.
Example: if $X$ is a line or a circle in $\mathbf{R}^3$, then the corresponding cohomology class of the complement takes value $\pm 1$ on any circle linked with $X$.