How do i save and retrieve custom attachment meta?

The field id has to match in both function so if your field id is foo the when you save you need to look for that id and when you save a checkbox field its smart to remove it if not set so:

function image_attachment_fields_to_save($post, $attachment) {  
    if( isset($attachment['foo']) ){  
        update_post_meta($post['ID'], 'foo', $attachment['foo']);  
    }else{
         delete_post_meta($post['ID'], 'foo' );
    }
    return $post;  
}

add_filter("attachment_fields_to_save", "image_attachment_fields_to_save", null, 2);