  Let $\gcd(k,j)$ denote the greatest common divisor of the integers $k$ and
$j$, and let $r$ be any fixed positive integer. Define $$ M_r(x; f) :=
\sum_{k\leq x}\frac{1}{k^{r+1}}\sum_{j=1}^{k}j^{r}f(\gcd(j,k)) $$ for any large
real number $x\geq 5$, where $f$ is any arithmetical function. Let $\phi$, and
$\psi$ denote the Euler totient and the Dedekind function, respectively. In
this paper, we refine asymptotic expansions of $M_r(x; {\rm id})$,
$M_r(x;{\phi})$ and $M_r(x;{\psi})$. Furthermore, under the Riemann Hypothesis
and the simplicity of zeros of the Riemann zeta-function, we establish the
asymptotic formula of $M_r(x;{\rm id})$ for any large positive number $x>5$
satisfying $x=[x]+\frac{1}{2}$.
