Here is a modification of my answer to a previous question asking to add margin notes the first time a reference is made. This uses the cleveref package to allow context-aware citations, which makes underlining the name as well as number easy.
Edit: As pointed out by @egreg below, the previous answer would break if a list of references was passed to \cref. To correct this, the check is now made to see if the passed argument contains a comma. If so, no underlining is performed, regardless of the references. In other words, this approach will underline the first time a reference is made by itself.
\documentclass{article}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage[left=1.5in,right=1in]{geometry}
\usepackage{cleveref}
\crefname{equation}{Equation}{Equations}
\crefname{figure}{Figure}{Figures}
\crefname{table}{Table}{Tables}
\usepackage{xstring}
\makeatletter
%Redefine \cref so that it will make a margin note if the passed label is referenced for the first time.
\let\oldcref=\cref
\def\cref#1{%
\IfSubStr{#1}{,}{\oldcref{#1}}{%
%check if the label has already been referenced.
\ifcsname marginnote@#1\endcsname
%already exists...therefore not the first citation
\oldcref{#1}%
\else
\underline{\oldcref{#1}}%}
\expandafter\gdef\csname marginnote@#1\endcsname{}%first citation...with this defined, will not underline again
\fi
}}
\makeatother
\author{John Doe}
\title{Automatic underlining of the first use of a reference}
\begin{document}
\maketitle
\begin{multicols}{2}
See \cref{fig:figure}. \lipsum[1]
A new reference to \cref{fig:figure} is not underlined.
Let's do the same with an equation.
\begin{equation}
\label{eq:1}f(x) = x^2
\end{equation}
Refering to \cref{eq:1} for the first time, there should be a marginal note, as is visible here, but it shoudl begin with ``Eq.'', not ``Fig.''.
Here we can test a list of references \cref{eq:1,tab:1,fig:figure} which should bypass the underling no matter the contents.
Adding another reference to \cref{eq:1} does not result in an underline; however, referring to \cref{tab:1} for the first time does.
\end{multicols}
% lets put a table and a figure
\begin{table}
\caption{Table title}
\label{tab:1}
\begin{tabular}{cc}
x & y \\ \hline
3 & 3 \\
4 & 4 \\ \hline
\end{tabular}
\end{table}
\begin{figure}
\centering\rule{150pt}{10pt}
\caption{A figure}\label{fig:figure}
\end{figure}
\end{document}
