Coffee is very nice in a soap, I use it for special customers, caffeine is a very efficient skin conditioner. You can use the milled beans directly, but my favorite process is to boil the milled coffee beans for a good 20 minutes, then cool the mixture and add lye to it, and finally of course make the soap with it (of course ratios have to be adjusted).
As
@Yooper already mentioned, it stinks a lot, but after a long curing (at least 2 months) the stench will go, I would recommend that you use fragrances rich in cardamom or spicy fragrances because they go well with coffee.