Optimizing digit sum and product with GMP
There are a few ways to speed up your division.  First, note that because rem is declared within the while loop, it's both constructed and destroyed every loop iteration.  That's not really necessary, so you could instead declare it outside the loop and simply assign a new value within the loop each time.  Also by changing the line from num = num / 10 to num /= 10, you avoid creating and destroying yet another temporary.  Applying both of those saves a little time, but it's still slower than the string method because you're essentially performing the division twice (once for num % 10 and again for num / 10).

The key is to do only a single division per loop, but you'll have to resort to using the underlying C function since it's not exposed to the C++ interface. Fortunately, it's simple to do so:

unsigned long digit;
while(num != 0) {
    digit = mpz_tdiv_q_ui(num.get_mpz_t(), num.get_mpz_t(), 10);
    sum += digit;
    pro *= digit;
}


On my machine this is slightly faster than the string method, and probably uses a little less memory.

Update:

Because the speed of that code relative to the string method varies based on what compiler optimizations are used, it's not necessarily always faster.  This version uses low-level GMP calls for more speed:

__mpz_struct *q = num.get_mpz_t();
while(*(q-&gt;_mp_d) != 0) {
    auto digit = mpn_divrem_1 (q-&gt;_mp_d, (mp_size_t) 0, 
            q-&gt;_mp_d, q-&gt;_mp_size, (mp_limb_t) 10);
    sum += digit;
    pro *= digit;
}


This makes a couple of assumptions that are important.  First, it assumes that num &gt; 0 and it dives deep into the internal structure of __mpz_struct so it will not be very durable to changes in GMP, should they decide to change the underlying representation of numbers.  However, with this code, I find that it's a bit faster on my machine than the string method, both with and without -O3 optimizations.

Also, note that within your range of integers, the sum of digits will always fit within a long int which will save time, but could equally be applied to the string method.