You can look for inspiration in the definition of \author in the LaTeX kernel:
\def\author#1{\gdef\@author{#1}}
An example with your commands:
\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\makeatletter
\newcommand\acadclass[1]{\def\@acadclass{#1}}
\newcommand\psetnum[1]{\def\@psetnum{#1}}
\fancyhead[C]{\@acadclass--Pset~\@psetnum}
\makeatother
\acadclass{Linear Algebra}
\psetnum{2}
\acadclass{Linear Algebra}
\psetnum{2}
\title{Some Title}
\author{Joe Shmoe}
\begin{document}
test
\end{document}
An image of the resulting page showing the header:

To have also the header if \maketitle is used, add
\let\ps@plain\ps@fancy
inside
\makeatletter, \makeatother.
If these definitions are going to be used in a .cls file, you can do
\@ifpackageloaded{fancyhdr}{}{}{\RequirePackage{fancyhdr}}
\pagestyle{fancy}
\newcommand\acadclass[1]{\def\@acadclass{#1}}
\newcommand\psetnum[1]{\def\@psetnum{#1}}
\fancyhead[C]{\@acadclass--Pset~\@psetnum}
(in particular, in a .cls file, you do not use \makeatletter, \makeatother).