They are equally good sentences.
In A, "to be interesting" is an infinitive phrase, acting as an adjective to complement the direct object "book" of the verb "think". "To be interesting" describes the book by telling us what you think of it.
You could also write "I think this book interesting", with no change in meaning. Again, "interesting" would be an adjective complement for the direct object, "book".
Here's a similar sentence:
"I found that teacher to be helpful"