Suppose I ask the following question: If we have $k$ categories and $m$ selections of an item, where each item can belong to one of the categories, how many possible enumerations of each category can we have?
This is a common combinatorics question which is answered by the stars-&-bars analogy. If you make a sequence with $m$ stars and $k-1$ bars, every possible orientation of stars and bars represents a completely unique enumeration of categories, and the set of possible orientations you can make is exhaustive. Therefore, the number of possible orientations you can make with those stars and bars, which is $m+k-1 \choose m$, is the answer to the question.
Similarly, if you specify that each category must have been chosen at least once, this is equivalent to having $k-1$ bars and $m-k$ stars. Thus the answer to that question is $m-1 \choose k-1$.
However, suppose we asked the following question: How many ways are there to select $m$ items out of $k$ categories where order of item selection matters? For example, if we have $3$ categories, and $5$ selections, one possible $k$-tuple is {2,0,3} (that is, 2 items of category 1 and 3 items of category 3). However this can be done in multiple orders of choosing categories ($5 \choose 2$ to be exact). For example, you can make the above choice with order 3-1-3-1-3 or 1-1-3-3-3. So what if we do a weighted sum of selecting each possible tuple, where the weight is given by the number of possible ways of selecting that tuple?
Well if each category is allowed to be selected any number of times, including $0,$ then the answer is actually simple. This is just all possible ways of selecting $m$ items, where each item can be one of $k$ categories. So the answer is $k^m.$
Now here's where I'm stuck. What is the answer to the above problem, with the constraint that every category is chosen at least once?
As far as I understand, to do this we would have to sum over every possible tuple, with the summand being the number of possible ways to select that tuple. So there are $m-1 \choose k-1$ tuples. But for each tuple, the number of ways of selecting that tuple is a multinomial coefficient, where the top term is $m$ and the bottom terms are the individual values in the tuple.
A very simple example is the following: Suppose there are $3$ categories and $4$ selections. Each category must be chosen at least once. Then there are ${3 \choose 2} = 3$ possible enumerations of categories, and we would sum over them using: $$ N = {4 \choose 2,1,1} + {4 \choose 1,2,1} + {4 \choose 1,1,2} = 36. $$
However, I don't know how to do this sum in general. For $m$ selections and $k$ categories I think we would have to set up the following sum,
$$ N = \sum_{n_1=1}^{m-k+1} \sum_{n_2=1}^{m-k +2-n_1} \sum_{n_3=1}^{m - k + 3 - n_1 - n_2} \dots \sum_{n_k = 1}^{m - n_1 - n_2 - \dots - n_{k-1} } {m \choose n_1, n_2, \dots, n_k}. $$
(I believe I set up the upper bounds properly, but I could be wrong.) I don't know how to do such a sum, or if it even has a closed form solution.