I was expecting it to be rubbish, but actually — surprise — it was a pretty good book.
Literal
Anyway rubbish [copula-だろう] [quot-と] was-thinking [however-だけど], surprisingly quite good book [copula-だった].
どうせ 'anyway / after all / as expected' introduces a pre-judgment the speaker doesn't really want to hold. どっこい here is used as an interjection of pleasant surprise ('but wait / surprise!') — pulling you up short with a good revelation rather than an objection. なかなか + positive evaluation means 'quite / pretty / unexpectedly good,' the positive sibling of the negative-only なかなか~ない.