The refcount package can extract the number from a reference. That only works for arabic page numbers, of course. And there must not be any \addtocounter{page}{...} or \setcounter{page}{...} between A and B. For those more complicated situations, \theCurrentPage of the pageslts package can be used.
\documentclass{scrbook}
\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage{refcount}
\usepackage{pageslts}
\pagenumbering{arabic}
\begin{document}
Here is label A. \label{A}
\newpage
text
\newpage
text
\newpage
Here is label B \label{B}
\makeatletter
\@tempcnta=\getpagerefnumber{B}\relax%
\advance\@tempcnta by -\getpagerefnumber{A}%
% (maybe
% \advance\@tempcnta by -1%
% depending on your definition of "between")
\xdef\pagedifference{\the\@tempcnta}%
\makeatother
There are \pagedifference~pages between labels A and B.
\makeatletter
\@tempcnta=-\getpagerefnumber{A}\relax%
\advance\@tempcnta by \thepage%
% (maybe \advance\@tempcnta by -1, depending on definition of "between")
\xdef\pagedifference{\the\@tempcnta}%
\makeatother
There are \pagedifference~pages between labels A and the current page.
\newpage
\pagenumbering{Roman}
Here is page \thepage{} (the \theCurrentPage{}.~page).
\xdef\mypageA{\theCurrentPage}
\newpage
text
\newpage
text
\addtocounter{page}{10}
Just added 10 to the page number here.
\newpage
Here is page \thepage{} (the \theCurrentPage{}.~page).
\xdef\mypageB{\theCurrentPage}
\makeatletter
\@tempcnta=\mypageB\relax%
\advance\@tempcnta by -\mypageA%
% (maybe \advance\@tempcnta by -1, depending on definition of "between")
\xdef\pagedifference{\the\@tempcnta}%
\makeatother
There are \pagedifference~pages between page A and the current page B.
\end{document}
\clearpage. – Martin Scharrer Dec 13 '11 at 18:02