How can I count solutions to $x_1 + \ldots + x_n = N$? I am interested in how many non-negative integer solutions there are to:
$$x_1 + \ldots + x_N = B$$
where at least $K$ of the variables $x_1, \ldots , x_N \geq C$
For example when:
$B = 5, N = 3, K = 2, C = 2$
I want to count the solutions to:
$$x_1 + x_2 + x_3 = 5$$
where at least $2$ of the variables are $\geq 2$.
I found the total number of candidate solutions using the $\binom{B+N-1}{B} = 21$
However, only $9$ of them have two variables $\geq 2$.
\begin{align*}
    2+0+3& =5\\
    2+1+2& =5\\
    3+0+2& =5\\
    1+2+2& =5\\
    3+2+0& =5\\
    0+2+3& =5\\
    0+3+2& =5\\
    2+3+0& =5\\
    2+2+1& =5
\end{align*}
I feel there is a connection to the Associated Stirling numbers of the second kind. But I can't place it :(
EDIT:
Here is my code for enumerating them all to count the number of ways of select B elements from a set of N (uniformly with replacement), such that you have at least C copies of K elements - also shows the output for this question I'm asking here as it's the core piece. Obviously can't be run for very large values of the parameters - that's why I'm here :) Code is here
Here is another example for B = 6, N = 3, C = 2 and K = 2 there are 16 solutions:
\begin{align*}
0+2+4& = 6\\
0+3+3& = 6\\
0+4+2& = 6\\
1+2+3& = 6\\
1+3+2& = 6\\
2+0+4& = 6\\
2+1+3& = 6\\
2+2+2& = 6\\
2+3+1& = 6\\
2+4+0& = 6\\
3+0+3& = 6\\
3+1+2& = 6\\
3+2+1& = 6\\
3+3+0& = 6\\
4+0+2& = 6\\
4+2+0& = 6\\
\end{align*}
There are a number of different and correct solutions below. I don't know which to accept. 

You could move to new variables $x_i' = x_i - C \ge 0$ for the variables with the minimum value $C$. Then the equation transforms to
$$
x'_1 + \ldots x'_K + x_{K+1} + \ldots x_N = B - K \, C
$$
assuming WLOG GRUMBL MUMBL that those variables are the first $K$ ones.
This is a problem of the form
$$
n_1 + \ldots + n_N = n \quad (n_i \ge 0) \quad (*)
$$
which is related to compositions from combinatorics. A composition of $n$ is a way to write $n$ as sum of integers $n_i \ge 1$. We need weak composition of $n$, which allows terms $n_i \ge 0$, but only those which have $N$ terms. The number of compositions of $n$ into $N$ parts is $\binom{n-1}{N-1}$, the number of weak compositions of $n$ into $N$ parts follows from looking at the number of compositions of $n+N$ into $N$ parts (and subtracting $1$ for each of the $N$ parts on both sides), so equation $(*)$ has
$$
\binom{n+N-1}{N-1} = \binom{B-K\,C+N-1}{N-1}
$$
solutions. 
Your example turns into
$$
x'_1 + x'_2 + x_3 = 5-2\cdot 2 = 1
$$
and should have $\binom{1+3-1}{3-1}=\binom{3}{2}=3!/(2!1!)=3$ solutions.
We find
$$
(x'_1, x'_2, x_3) \to (x_1, x_2, x_3) \\
(1,0,0) \to (3,2,0) \\
(0,1,0) \to (2,3,0) \\
(0,0,1) \to (2,2,1)
$$
The found solution in $x'_i$ has then to be transformed back via $x_i = x'_i + C$, see the right side above.
Update:
The above assumed the constraints were at fixed positions and attached the constraints $x_i \ge C$ to the variables $1$ to $K$.
It should be clear that if the constraints were assigned to a different subset of variables indexed by $I = \{ I_1, \ldots, I_K \} \subset \{1, \ldots, N \}$ we end up with the same solutions, albeit permutated, along to the permutation of the indices. 
E.g. for the example we have:
$$
(x_1, x'_2, x_3') \to (x_1, x_2, x_3) \\
(1,0,0) \to (1,2,2) \\
(0,1,0) \to (0,3,2) \\
(0,0,1) \to (0,2,3)
$$
and
$$
(x_1', x_2, x_3') \to (x_1, x_2, x_3) \\
(1,0,0) \to (3,0,2) \\
(0,1,0) \to (2,1,2) \\
(0,0,1) \to (2,0,3)
$$
These are all $9$ solutions.
What we need here are combinations, as we are interested only in the chosen subset, not in what order the elements were chosen. 
There are $\binom{N}{K}$ $K$-combinations from a set of $N$ elements.
Note: This part needs $C \ge 1$, otherwise the resulting tuples are not distinct. There might be further conditions to watch, to justify this factor, see the comments.
Result:
There should be
$$
\binom{N}{K} \binom{B-K\,C +N-1}{N-1}
$$
solutions to the original problem. Caution: This might degrade to an upper bound, see the comments.
