You doing the good thing.
I actually used this training for like a year and a half, and it worked very well. Our dog was free when we were home, and as soon as we had to leave or to go to bed, we would put him in his crate. At first it was very difficult, but then with time, love and encouragment, he would go inside by himself.
You should try to only give him treats inside it, so he can associate the crate training to a good thing.
And as our friend said, never punish him or force him to go inside. And NEVER, EVER, look at him when he barkes and cries inside. Also, only open him when he is in a calm and relaxed mode.
Hope this will help.