Find the cheapest combination of raw foods that fulfill nutritional requirements
Use integer linear programming.  Suppose you have $n$ foods.  Let $x_1,\dots,x_n$ be zero-or-one variables, with the intention that $x_i=1$ means you include food $i$ in the combination.  Then the price is a linear function of these $x$'s, so that's your objective function you are minimizing.  If you want the total carbs to be within a range, you can express that as a linear inequality (e.g., $\ell \le c_1 x_1 + \dots + c_n x_n \le u$, where $\ell,u$ are the lower and upper bounds of the range and $c_i$ is the amount of carbs in food $i$).  Feed this to an off-the-shelf ILP solver, and it should give you the optimal answer.