A generalized Burnside's lemma

Let $G$ be a finite group acting on a set $X$, and let $S\subseteq G$ be a union of conjugacy classes. Then I believe I can prove:

$$\sum_{[x]\in X/G} \frac{|G_x \cap S|}{|G_x|} = \sum_{g\in S} \frac{|X^g|}{|G|}$$

where $G_x$ is the stabilizer of $x\in X$ and $X^g$ is the fixed-point set of $g\in G$. The assumption on $S$ makes ${|G_x \cap S|}$ depend only on the orbit $[x]$ of $x$.

When $S=G$, this reduces to the orbit-counting theorem. Does the general form have a name? Or is it a special case of something that has a name? Is there somewhere I can cite for it?

-
Reading your second sentence, I am reminded of this reminiscence (ams.org/journals/bull/1988-19-02/S0273-0979-1988-15735-7/…) of Hugo Rossi on Errett Bishop: "In this time I also learned that when Errett said that he thought he could prove something, he meant that he could prove it, but that he was not yet happy with the exposition." – Todd Trimble Jun 4 '14 at 14:50
One special case: Take the conjugacy action of $G$ on itself. Then the right-hand side is the number of classes making up $S$, say $s$. Dividing by $|S|$ shows that the probability that elements $g \in G$ and $h \in S$ (chosen uniformly at random) commute is $s/|S|$. – Mark Wildon Jun 5 '14 at 14:41

I am not sure that the following remarks contribute much of value, but observe that the real content of the given formula is already there in the case where $S$ consists of just one class and $X$ is a single $G$-orbit. To get the given general formula, just sum over all classes in $S$ and all orbits in $X$.
To prove the formula in the one-class, one-orbit case, note that $|X^s|$ is constant for $s \in S$ since $S$ is a single class, so the right side of the desired equation is just $|S||X^s|/|G|$, where $s$ is an arbitrary element of $S$. Also, since $X$ is a single orbit, the left side is $|G_x \cap S|/|G_x|$, where $x \in X$ is arbitrary. What we want, therefore, is $$\frac{|G_x \cap S|}{|G_x|} = \frac{|S||X^s|}{|G|}\,.$$ Since $|X| = |G|/G_x|$, this is equivalent to $|X||G_x \cap S| = |S||X^s|$. This is clearly true, however, because both sides equal the cardinality of the set of ordered pairs $$P = \{ (x,s) \mid x \in X, s \in S, x^s = x\}.$$ Note that the usual proof of the orbit counting theorem also involves counting a set of ordered pairs in two ways.