Sets of solutions which it is hard to uniformly sample from, but easy to integrate functions over? (Or compute expectations over?)
There is no such problem.  If it's hard to sample, it's hard to integrate.

Here is a sketch of the reason why.  Represent every solution $x$ by a $n$-bit string $x_1,\dots,x_n$.  If you can integrate over the set of all solutions, here is an algorithm to sample from all solutions:


Count the number of solutions; call it $N_0$.  (As you say, this can be done efficiently, as it is just an integral.)  Count the number of solutions $x$ such that $x_1=1$; call it $N'_0$.  (This is an integral of the function $f(x)$ over all solutions, where $f(x_1,\dots,x_n) = x_1$, so it can be computed efficiently.)  With probability $N'_0/N_0$, set $y_1 = 1$, else set $y_1 = 0$.
Count the number of solutions $x$ such that $x_1=y_1$; call it $N_1$.  (This is another integral.)  Count the number of solutions $x$ such that $x_1=y_1$ and $x_2=1$; call it $N'_1$.  With probability $N'_1/N_1$, set $y_2 = 1$, else set $y_2 = 0$.
Count the number $N_2$ of solutions $x$ such that $x_1=y_1$ and $x_2=y_2$, and the number $N'_2$ of solutions $x$ such that $x_1=y_1$ and $x_2=y_2$ and $x_3=1$.  With probability $N'_2/N_2$, set $y_3=1$, else set $y_3=0$.
And so on.  When this procedure finishes, output $y_1,y_2,\dots,y_n$.  This will be a valid solution, sampled uniformly at random from the set of all solutions.


It's easy to see that if you have a way to compute the exact integral, you'll obtain a way to sample exactly uniformly at random.  I expect it will follow that if you can approximate the integral, you can sample approximately uniformly at random; I'll let you compute the parameters and relation between the two approximations.



You can also implement this algorithm using expectations.  Let $X$ be a r.v. that is uniformly distributed on the set of all solutions.  Set $y_1=1$ with probability $\mathbb{E}[X_1]$; set $y_2=1$ with probability $\mathbb{E}[\mathbf{1}_{X_1 = y_1} \cdot X_2] / \mathbb{E}[\mathbf{1}_{X_1 = y_1}]$; and so on.  Here I use $\mathbf{1}_{e(X)}$ to represent a function that is 1 if $e(X)$ holds, and 0 otherwise.  Why does this work?  Well, $\Pr[X_1=1] = \mathbb{E}[X_1]$, and

$$\Pr[X_2=1|X_1=y_1] = {\Pr[X_1 = y_1 \land X_2=1] \over \Pr[X_1=y_1]}
= {\mathbb{E}[\mathbf{1}_{X_1 = y_1} \cdot X_2] \over \mathbb{E}[\mathbf{1}_{X_1 = y_1}]}.$$