I refer to this site:
http://developer.android.com/guide/topics/ui/declaring-layout.html first because that site has a lot of great information so it should be your number one resource, but also because that page has an example of how to do what you want (about half way down the page in the Attributes section)
Basically, the R.id. value is just a unique number used to locate the View. You use the findViewById() method (found in a Context object, and an Activity is a Context, so you can call it directly on your Activity) to locate the View you need. It is returned as a generic View type, so if you need to use Button methods you will need to cast it.