This is a knapsack problem. Let $y_b =1$ if item $b\in B$ is chosen, and $0$ otherwise (assuming sets $B_i$ are already defined).
So you want to maximize
$$
\sum_{b \in B} v(b)y_b
$$
subject to
$$
\sum_{b \in B} c(b)y_b \le L \\
y_b \in \{0,1\}
$$
You can solve it with a solver or with dynamic programming. The subset conditions are directly taken into account in the variable definitions, so there is nothing else to it, unless I misunderstood the problem.
After clarification, what follows seems to be what the OP wants:
Or, maybe you mean sets $B_i$ are not known ? In this case I would suggest defining variables $y_a^{A_i}$ that take value $1$ if item $a\in A_i$ is chosen, and $0$ otherwise. You would then maximize
$$
\sum_{i}\sum_{a \in A_i}v(a)y_a^{A_i}
$$
subject to
$$
\sum_{i}\sum_{a \in A_i}c(a)y_a^{A_i} \le L\\
\sum_{a \in A_i} y_a^{A_i} = k_i \quad \forall i\\
y_a^{A_i} \in \{0,1\}\quad \forall a \in A_i \; \forall i
$$
This linear program creates your sets $B_i$:
$$
B_i := \{ a\in A_i\;|\; y_a^{A_i} = 1 \}
$$