Let \(K\le H\) be two finite groups and let \(C\le A\) be two finite abelian groups, with H acting on A as a group of automorphisms admitting C as a K-invariant subgroup. We study the homogeneous space \(X:=\left( H\ltimes A\right) /\left( K\ltimes C\right) \) and determine the decomposition of the permutation representation of \(H\ltimes A\) acting on X. We then characterize when this is multiplicity-free, that is, when \(\left( H\ltimes A,K\ltimes C\right) \) is a Gelfand pair. If this is the case, we explicitly calculate the corresponding spherical functions. From our general construction and related analysis, we recover Dunkl’s results on the q-analog of the nonbinary Johnson scheme.