Well, for that, you will have to use pointers. There's a great tutorial for them here on this site- you won't have to change much for your code to work correctly.
In main you make an int called a.
You then make an Interger object and pass a into its constructor by value, thereby assigning data the value of a (4).
Doing add1() after this then increments data's value by 1.
test.data is now 5, but the local variable "a" has nothing to do with the data value in your object. The local variable a's value is unchanged.
Heh, sorry if this is poorly worded. As Ispil said, if you wanted your local variable a to now be "intertwined" with the object's data value, you'd have to use pointers.