This is an extension to Norbert's answer. I am following the book "Vector Measures" by Diestel + Uhl.
We could define a $\mu$-measurable function to be Bochner integrable if and only if $\int_X \|f\| \ d\mu <\infty$. But what does "$\mu$-measurable" mean? Well, the Pettis Measurability Theorem says that this happens if and only if
- there is $A\subseteq X$ with $\mu(X\setminus A)=0$, and $f(A)=\{f(x):x\in A\}$ is separable in $B$;
- for each $\varphi\in B^*$, the scalar-valued function $\varphi\circ f$ is measurable.
Adjusting $f$ to be $0$ on $X\setminus A$, we may assume that $f(X)$ is separable. Then we can find a countable set $(\varphi_n)$ in $X^*$ which separates the points of $f(X)$, i.e. if $y\in f(X)$ and $\varphi_n(y)=0$ for all $n$, then $y=0$. Now follow Norbert's answer. So the result is true for any $B$.
Edit: In answer to Mark: Let $B=\ell^2([0,1])$ a very much non-separable Banach space. Define $f:[0,1]\rightarrow B$ by $f(t) = e_t$, where $(e_t)_{t\in[0,1]}$ is the canonical orthonormal basis for $B$. Then for any $\varphi\in B^*$ there is a countable set $A$ such that $\varphi(e_t)=0$ if $t\not\in A$. So $\varphi(f(t))=0$ off $A$; in particular, if $[0,1]$ is given Lebesgue measure, then $\varphi\circ f=0$ almost everywhere. It follows that $f$ is Pettis integrable (see http://en.wikipedia.org/wiki/Pettis_integral ) and has zero integral over any measurable $E\subseteq [0,1]$. But of course $f$ is not zero almost everywhere.