Hold the B button, then run up to the Koopa shell. If you do it correctly, the shell should automatically end up in your arms.